home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Games / dynAMIte / Developer / C / dynamite.h < prev    next >
C/C++ Source or Header  |  2001-06-24  |  7KB  |  201 lines

  1. #ifndef DYNAMITE_H
  2. #define DYNAMITE_H
  3. /*
  4. **    $VER: dynamite.h 40.0 (3.6.2001)
  5. **
  6. */
  7.  
  8. #ifndef EXEC_NODES_H
  9. #include <exec/nodes.h>
  10. #endif /* EXEC_NODES_H */
  11.  
  12. #ifndef EXEC_LISTS_H
  13. #include <exec/lists.h>
  14. #endif /* EXEC_LISTS_H */
  15.  
  16. #ifndef EXEC_SEMAPHORES_H
  17. #include <exec/semaphores.h>
  18. #endif /* EXEC_SEMAPHORES_H */
  19.  
  20.  
  21. /* player->status */
  22. #define PA_NONE 0      /* no player */
  23. #define PA_VISI 1      /* visitor */
  24. #define PA_LOGGEDIN 2  /* just logged in/after a game */
  25. #define PA_PLAYING 3   /* is in game (no matter if he's dead) */
  26. #define PA_COUNTDOWN 4 /* this is of no use. players only have this status if they logged in. */
  27. #define PA_DEAD 5      /* this is of no use, it's not meant to see if a player is */
  28.                        /* actually dead.  use player.dead instead.  it's only set */
  29.                        /* after a successfull login for the other players */
  30. #define PA_WON 6       /* a player has this status if he won the last round */
  31.  
  32. /* dynasema->gamerunning */
  33. #define GAME_CLOSEGAME 0,  /* transitional state to GAME_MENU after connection got closed */
  34. #define GAME_MENU 1        /* game is in menu eg: login screen */
  35. #define GAME_ENDGAME 2     /* transitional state to GAME_MENU after effect has been drawn */
  36. #define GAME_EFFECT 3      /* game draws effect after a match */
  37. #define GAME_COUNTDOWN 4   /* game is doing the countdown */
  38. #define GAME_GAME 5        /* game is running */
  39. #define GAME_HURRYUP 6     /* game is running and is in hurry up mode */
  40.  
  41. #define DIR_NONE    -1
  42. #define DIR_DOWN    0
  43. #define DIR_RIGHT    1
  44. #define DIR_LEFT    2
  45. #define DIR_UP        3
  46.  
  47. #define SPEED_NORMAL    4
  48. #define SPEED_SLOW    3
  49. #define SPEED_FAST    6
  50.  
  51. #define BLOCK_FAKEBLOCK        -1    /* used for remote/kick bombs which are placed into the map */
  52. #define BLOCK_NOBLOCK        0    /* empty field */
  53. #define BLOCK_HARDBLOCK        1    /* non-destroyable block */
  54. #define BLOCK_DESTROYABLE    2    /* destroyable block */
  55. #define BLOCK_BOMB        3    /* normal bomb */
  56. #define BLOCK_BORDERWALL1    4    /* borderblocks are equal to hardblock */
  57. #define BLOCK_BORDERWALL2    5
  58. #define BLOCK_BORDERWALL3    6
  59. #define BLOCK_BORDERWALL4    7
  60. #define BLOCK_BORDERWALL5    8
  61. #define BLOCK_BORDERWALL6    9
  62.  
  63. #define BLOCK_ADDBOMB    19    /* block which contains a bomb */
  64.  
  65. #define BO_EXPANDFLAME    1    /* types for bonusgrid */
  66. #define BO_ADDBOMB    2
  67. #define BO_FLAMEMAX    3
  68. #define BO_BOMBMAX    4
  69. #define BO_RANDOMWALL    5
  70. #define BO_BOMBS2BLOCKS    6
  71. #define BO_DROPALL    7
  72. #define BO_EXPLALL    8
  73. #define BO_FASTER    9
  74. #define BO_SLOWER    10
  75. #define BO_SHORTERFUSE    11
  76. #define BO_LONGERFUSE    12
  77. #define BO_SHORTERFLAME    13
  78. #define BO_SWAPCONTROLSRL    14
  79. #define BO_FEWERBOMBS    15
  80. #define BO_NODROP    16
  81. #define BO_SHIELD    17
  82. #define BO_STANDSTILL    18
  83. #define BO_TELEPORT    19
  84. #define BO_REMOTEBOMB    20
  85. #define BO_BACK2BASIC    21
  86. #define BO_KICKBOMB    22
  87. #define BO_SABER    23
  88. #define BO_SWAPCONTROLSUD    24
  89. #define BO_MAGNET    25
  90. #define BO_PHOENIX    26
  91. #define BO_DOHURRYUP    27
  92. #define BO_INVISIBLE    28
  93. #define BO_DUELL    29
  94. #define BO_AFTERBURNER    30
  95.  
  96. #define BOMB_NORMAL    0    /* normal bomb */
  97. #define BOMB_GEN        1    /* predefinend bomb */
  98. #define BOMB_REMOTE    2    /* remote bomb */
  99. #define BOMB_KICK        3    /* kick bomb */
  100.  
  101. struct serverdata {
  102.   char servername[34]; /* name of the server */
  103.   char sysopname[18];  /* name of the sysop */
  104.   WORD maxslots;       /* how many players allows this server */
  105.   WORD maxobservers;   /* how many observers allows this server */
  106. };
  107.  
  108. struct tempbomb {
  109.     struct    MinNode ln;
  110.     WORD    x;        /* x blockpos */
  111.     WORD    y;        /* y blockpos */
  112.     WORD    x1;        /* x pos (pixel) */
  113.     WORD    y1;        /* y pos (pixel) */
  114.     WORD    fuse;        /* >0 bomb is still ticking, =0 bomb is going to explode */
  115.     WORD    range;        /* flamlength */
  116.     WORD    dir;        /* in case of kick/remote bomb holds the direction */
  117.     WORD    originx;    /* holds the x/y pos (block) where the bomb was placed */
  118.     WORD    originy;    /* (useful to find kick/remotebombs) */
  119.     WORD    type;        /* is set to one of BOMB_#? */
  120. };
  121.  
  122. struct player {
  123.     WORD    num;
  124.     LONG    status;
  125.     WORD    dead;
  126.     WORD    x;            /* xpos (pixel) + border (24 pixel) */
  127.     WORD    y;            /* ypos (pixel) + border (16 pixel) */
  128.     WORD    px;            /* xpos (block number) */
  129.     WORD    py;            /* ypos (block number) */
  130.  
  131.     WORD    bombc;            /* how many bombs this player has currently ticking */
  132.     WORD    maxkickbombs;        /* how many kickbombs this player has */
  133.     struct    MinList *bomblist;    /* doubly linked list of bombs belonging to this player */
  134.     struct    tempbomb *remotebomb;    /* pointer to a bomb of bomblist which is his remotebomb else 0 */
  135.     struct    tempbomb *kickbomb;    /* pointer to a bomb of bomblist which is his kickbomb else 0 */
  136.  
  137.     WORD    maxrange;    /* flamelen of player ranging from 2 to 15 */
  138.     WORD    maxbombs;    /* how many bombs this player can drop */
  139.     WORD    fuselen;    /* fuselength of bombs the player can drop */
  140.     WORD    speed;        /* player speed; SPEED_NORMAL=4, SPEED_SLOW=3, SPEED_FAST=6 */
  141.     WORD    speedc;        /* >0 = player has other speed (SPEED_SLOW, SPEED_FAST) */
  142.  
  143.     WORD    swaprlc;    /* >0 = swaped horizontal controls */
  144.     WORD    swapudc;    /* >0 = swaped vertical controls */
  145.     WORD    nodropc;    /* >0 = player can't drop bombs */
  146.  
  147.     WORD    shieldc;    /* >0 = player has shield */
  148.  
  149.     WORD    standstillc;    /* >0 = player can't move */
  150.  
  151.     WORD    invisiblec;    /* >0 = player is invisible */
  152.  
  153.     WORD    afterburnerc;    /* >0 = player has afterburner */
  154.  
  155.     WORD    b2bc;
  156.  
  157.     WORD    flamethrowerc;    /* >0 = player has lightsabre */
  158.     WORD    flamethrowerdir;    /* direction of lightsabre */
  159.     WORD    flamethrowerr;    /* range of light sabre */
  160.  
  161.     WORD    magnetc;    /* >0 = this player has magnet enabled */
  162.     WORD    magnetdir;    /* direction of magnet */
  163.  
  164.     char    name[34];    /* players name */
  165.     char    system[64];    /* players systemstring */
  166. };
  167.  
  168. struct dynamitesemaphore {
  169.     struct    SignalSemaphore sema;    /* embedded signalsemaphore */
  170.     LONG    opencnt;    /* you must increase this by 1 if you are going to use the */
  171.                 /* semaphore the first time. decrease it by 1 if you are done */
  172.  
  173.     LONG    quit;        /* dynamite will set this to 1 if it wants to quit.  Check this */
  174.                 /* from time to time and end your program if quit gets set to 1 */
  175.  
  176.     LONG    gamerunning; /* is set to one of GAME_#? */
  177.  
  178.     LONG    frames;        /* once a game is running this long will be increased by 1 */
  179.                 /* every frame. */
  180.  
  181.     LONG    walk;        /* set to one of DIR_ to make the player move or stop */
  182.     LONG    drop;        /* set to 1 to drop a bomb */
  183.     LONG    dropkick;    /* set to 1 to drop a kickbomb */
  184.  
  185.     LONG    thisplayer;    /* number of this player in playerarray (>7 = observer) */
  186.     struct    player *players[16];        /* array ptr of players (15 entries max; >7 = observer) */
  187.  
  188.     LONG    mapwidth;    /* holds the width of the map in blocks */
  189.     LONG    mapheight;    /* holds the height of the map in blocks */
  190.  
  191.     APTR    grid;        /* array ptr to the actual map (29 entries max). each entry contains 1 line of the map without powerups */
  192.     APTR    bonusgrid;    /* array ptr to the bonus map (29 entries max). each entry contains 1 line of the bonusmap */
  193.  
  194.     char    addbubble[10];    /* any string copied to this array will be shown as bubble */
  195.                 /* dynamite will clear the string after successful */
  196.                 /* creation of the bubble */
  197.  
  198.   struct serverdata *serverdata; /* see serverdata for details */
  199. };
  200. #endif
  201.